<template>
    <div class="xl-table">
        <xlUntil
                text="在孵团队"
                @addForm="addTeam"
                @delBatch="delBatch"
                @searchKeyWord="searchKeyWord"
                :searchColumns="columns"
                :add-btn="true"
                :export-xls-data="columns"
                :queryParam="queryParam"
        >
        </xlUntil>
        <div class="xl-table-content">
            <xlTable
                    :columns="columns"
                    :dataSource="data"
                    rowKey="id"
                    :pagination="pagination"
                    :loading="loading"
                    @change="handleTableChange"
                    bordered
                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
                >
                <template v-slot:action="scope">
                    <a @click="seeForm(scope.record)">查看</a>
                </template>
            </xlTable>
        </div>
        <xlForm ref="xlForm" @handleOk="handleOk"></xlForm>
        <xlAdd @editForm="editForm" ref="xlAdd"></xlAdd>
        <seeForm ref="seeForm"></seeForm>
    </div>
</template>

<script>

    import xlMixin from '@/components/mixin/index'
    import xlForm from './model/form'
    import xlAdd from './model/add'
    import seeForm from './model/see'
    export default {
        name: "index",
        mixins:[xlMixin],
        data(){
            return{
                columns:[
                    {
                        title: '序号',
                        key: 'rowIndex',
                        align: "center",
                        fixed: 'left',
                        width:'100px',
                        sorter: (a) => a.id,//排序
                        customRender: function (t, r, index) {
                            return parseInt(index) + 1;
                        }
                    },
                    {
                        title: '团队名称',
                        fixed: 'left',
                        width: '200px',
                        dataIndex: 'teamName',
                        type:'input'
                    },
                    {
                        title: '入驻时间',
                        dataIndex: 'joinDate',
                        type:'date'
                    },
                    {
                        title: '行业领域',
                        dataIndex: 'industryDomain',
                        type: 'input'
                    },
                    {
                        title: '使用场地面积',
                        dataIndex: 'rentArea',
                        type:'input.number',
                        searchVisible:true
                    },
                    {
                        title: '员工人数',
                        dataIndex: 'employeeNum',
                        type:'input.number',
                        searchVisible:true
                    },
                    {
                        title: '获投融资金额',
                        dataIndex: 'hatchedAmt',
                        type:'input.number',
                        searchVisible:true
                    },
                    {
                        title: '操作',
                        dataIndex: 'action',
                        align: "center",
                        fixed: 'right',
                        width:'150px',
                        scopedSlots: {customRender: 'action'},
                    }
                ],
                url: {
                    list: "/system/api/carrierTeamInfo/pageList",
                    add: '/system/api/carrierTeamMore/save',
                    edit: '/system/api/carrierTeamMore/save',
                    delete: "/system/api/carrierTeamInfo/remove",
                    deleteBatch: "/system/api/carrierTeamInfo/remove",
                    exportXlsUrl: "/system/api/carrierTeamInfo/exportExcel",
                    importExcelUrl: "/system/api/carrierTeamInfo/importExcel",
                    importExcelDemoUrl: "/system/api/carrierTeamInfo/importTemplate",
                }
            }
        },
        components: {
            xlForm,
            xlAdd,
            seeForm
        },
        created(){
            this.formatMerge()
            this.pageOnload()
        },
        methods:{
            addTeam() {
                this.$refs.xlAdd.formatForm({})
                this.$refs.xlAdd.visible = true
            },
            editForm(data) {
                //修改方法
                this.$refs.xlForm.tableTitle = '修改'
                this.$refs.xlForm.formatForm(data)
                this.$refs.xlForm.type = 2
            }
        }
    }
</script>

<style scoped lang="less">
    .xl-table{
        .xl-table-content{
            padding: 16px;
        }
    }
</style>
